//客户端
package com.callback;

public class User {
    private String name;
    private App app;
    public User(String name, App app){
        this.name = name;
        this.app = app;
    }

    public void buy(String thing){
        System.out.println("用户端：购买" + thing);
        app.order(new MyCallback(), thing);  //被调用方的接口
        System.out.println("用户端：物品购买中，请耐心等待");
    }
}
